package com.zhiyume.service.util;


/**
 * @author
 * @createTime 2014-3-26 下午2:39:10
 * @description
 */
public class SqlUtil {
	
	public static String escapeLikeKey(String key){
		if(key == null) return "";
		key = key.trim();
		key = key.replace("'", "''");
		key = key.replace("[", "[[]");
		key = key.replace("%" , "[%]");
		key = key.replace("_", "[_]");
		key = key.replace("^", "[^]");
		return key;
	}
	
	public static String escapeEqualKey(String key){
		if(key == null) return "";
		key = key.trim();
		return key.replace("'", "''");
	}

}
